import React, { Component } from 'react'
import { HashRouter as Hash, Route, Switch, Redirect } from "react-router-dom"
import lazyload from '../utils/lazyload'
export class MainRouter extends Component {
    render() {
        return (
            <Hash
                basename=''
            >
                <Route component={MainLayout} />
            </Hash>
        )
    }
}

export class MainLayout extends Component {
    render() {
        return (
            <div className='layout'>
                <Switch>
                    <Route path='/' exact render={() => <Redirect to='/login' />} />
                    <Route path='/login' component={lazyload(() => import('./login'))} />
                    <Route path='/main' component={lazyload(() => import('./main'))} />
                </Switch>
            </div>
        )
    }
}